package com.example.synatx.datetime;

import java.time.LocalTime;
import java.time.temporal.ChronoField;

/**
 * @author guoxh
 * @date
 * @desc
 */
public class LocalTimeTest {

    public void test01(){
        LocalTime time = LocalTime.of(13,27,58);
        int hour = time.getHour();
        int minute = time.getMinute();
        int second = time.getSecond();
    }

    public void test02(){
        LocalTime localTime = LocalTime.now();
        int hour = localTime.get(ChronoField.HOUR_OF_DAY);
        int minute = localTime.get(ChronoField.MINUTE_OF_HOUR);
        int second = localTime.get(ChronoField.SECOND_OF_MINUTE);
    }

    public void test03(){
        LocalTime localTime = LocalTime.parse("13:39:58");
        System.out.println(localTime.toString());
    }
}
